-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: Deprecate sort=None for union and implement sort=True #25980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
expected = i1.union(i2, sort=sort).union(i3, sort=sort) | ||
|
||
warning = FutureWarning if sort is None else None | ||
with tm.assert_produces_warning(warning): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would just be easier to move the warnings to a separate test since this will eventually be ripped out anyway
Codecov Report
@@ Coverage Diff @@
## master #25980 +/- ##
===========================================
- Coverage 91.82% 41.91% -49.92%
===========================================
Files 175 175
Lines 52540 52562 +22
===========================================
- Hits 48247 22030 -26217
- Misses 4293 30532 +26239
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #25980 +/- ##
===========================================
- Coverage 91.87% 41.81% -50.07%
===========================================
Files 180 174 -6
Lines 50859 50711 -148
===========================================
- Hits 46726 21204 -25522
- Misses 4133 29507 +25374
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you merge master when you have a chance
pandas/bin/activate
Outdated
@@ -0,0 +1 @@ | |||
/Users/paul/anaconda/bin/activate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like some extra files got included
Thanks for the PR @reidy-p ! Looks like this has gone stale though, so closing to clean up our queue. Please ping if you'd like to pick it back up |
git diff upstream/master -u -- "*.py" | flake8 --diff
This is a WIP pull request because I wanted to make sure I'm going in the right direction before continuing.
In #24959 it was agreed that the default for some of the set operations should be
sort=None
for backwards compatibility in 0.24.1.sort=None
generally tries to sort in all cases except when the two indices are equal or one of the indices is empty. This meant that in a future release we could introduce a propersort=True
which would try to sort in all cases and change the default tosort=False
in all cases.Are there any potential problems with this plan?
In this PR I have started to deprecate
sort=None
forIndex.union
and to introducesort=True
.sort=None
is currently the default for this set operation so aFutureWarning
will be given by default. I will make similar changes to theunion
method in all the index classes if this is the approach we want to take.